package com.qf.spring2202.ioc.service.impl;

import com.qf.spring2202.ioc.dao.UserDao;
import com.qf.spring2202.ioc.service.UserService;

public class UserServiceImpl implements UserService {

    // 依赖的是接口类型，没有依赖具体的实现类，这样就可以不修改源代码的情况下进行实现类的替换
    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void helloUser() {
        System.out.println("hello spring user");
        System.out.println("========================");
        userDao.helloUser();
    }
}
